package com.h3c.ptability.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.h3c.ptability.dto.PtDeptDTO;
import com.h3c.ptability.dto.PtUserDeptDTO;
import com.h3c.ptability.entity.PtUserDept;

import java.util.List;

/**
 * Copyright (C), 2020-2020, h3c
 * FileName: IPtUserDeptService
 *
 * @Author: l22886
 * @Date: 2022-03-14
 * Description: pt_user_dept service
 * Version: 1.0
 */
public interface IPtUserDeptService extends IService<PtUserDept> {

    /**
     * @title: selectFuzzyByDto
     * @description: 模糊查询操作
     * @params: [ dto ]
     * @return: java.util.List
     * @createTime: 2022-03-14
     * @version: 1.0
     * @author: l22886
     */
    public List<PtUserDeptDTO> selectFuzzyByDto(PtUserDeptDTO dto);

    /**
     * @title: selectByDto
     * @description: 精确查询操作
     * @params: [ dto ]
     * @return: java.util.List
     * @createTime: 2022-03-14
     * @version: 1.0
     * @author: l22886
     */
    public List<PtUserDeptDTO> selectByDto(PtUserDeptDTO dto);

    /**
     * @title: insertDto
     * @description: 插入操作
     * @params: [ dto ]
     * @return: Integer
     * @createTime: 2022-03-14
     * @version: 1.0
     * @author: l22886
     */
    public Integer insertDto(PtUserDeptDTO dto);

    /**
     * @title: updateDto
     * @description: 修改操作
     * @params: [ dto ]
     * @return: Integer
     * @createTime: 2022-03-14
     * @version: 1.0
     * @author: l22886
     */
    public Integer updateDto(PtUserDeptDTO dto);

    /**
     * @title: deleteDto
     * @description: 删除操作
     * @params: [ dto ]
     * @return: Integer
     * @createTime: 2022-03-14
     * @version: 1.0
     * @author: l22886
     */
    public Integer deleteDto(PtUserDeptDTO dto);

    /**
     * 查询用户有权限的部门id列表
     * @param userId
     * @param domainAccount
     * @param appId
     * @return
     */
    List<String> getUserDeptPermission(String userId, String domainAccount, String appId);

    List<String> getUserDeptPermissionforHrSign(String userId, String domainAccount, String appId);
    /**
     * 查询用户有权限的部门id列表(hr-sign专用)
     * @param userId
     * @param domainAccount
     * @param appId
     * @return
     */
    List<String> getUserDeptPermissionHrSign(String userId, String domainAccount, String appId);


    List<Integer> getUserDeptPermissionWithDeptLevel(String appId, String domainAccount, Integer deptLevel);

    /**
     * 获取有权限的部门树
     * @param appId
     * @param workerId
     * @param flag  是否根据有权限的部门构建
     * @return
     */
    PtDeptDTO getAuthorizeChildTree(String appId, String workerId, Boolean flag);

    /**
     * 返回树结构
     * @param root
     * @return
     */
    List<PtDeptDTO> changeRootToChildList(PtDeptDTO root);
}
